package com.example.campustalent.adapter

import com.bumptech.glide.Glide
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.example.campustalent.R
import com.example.campustalent.bean.StudyInfo
import com.example.campustalent.bean.UserInfoBean

/**
 *@author: wangtianxiong
 *@time: 2022/3/14
 *@describe:
 *
 */
class StudyContentAdapter : BaseQuickAdapter<StudyInfo.StudyDetailInfo, BaseViewHolder>(
    R.layout.item_public) {
    override fun convert(helper: BaseViewHolder, item: StudyInfo.StudyDetailInfo) {
        helper.setText(R.id.tv_title, item.title)
            .setText(R.id.tv_content, item.content)
        if (!item.imageUrl.isNullOrBlank()){
            helper.setGone(R.id.iv_image, true)
            Glide.with(mContext).load(R.mipmap.img).into(helper.getView(R.id.iv_image))
        }else {
            helper.setGone(R.id.iv_image, false)
        }
    }

}